/**
 * @file login.js
 * @author hj
 * @date 2016-11-10
 */
import Vue from 'vue';
import App from 'src/app';
import Router from 'vue-router';

/* 加载页面 */
import loginPage from './vue/login.vue';
import forgetPage from './vue/forget.vue';
import registerPage from './vue/register.vue';
import registerSuccuesPage from './vue/registerSuccues.vue';
import loginSucessPage from './vue/loginSucess.vue';
import EmailPage from './vue/Email.vue';
import PhoneNumberPage from './vue/PhoneNumber.vue';
import PaymentSucceePage from './vue/PaymentSuccee.vue';
import WalletPage from './vue/Wallet.vue';
import payResetPage from './vue/payReset.vue';
import DebitCardPage from './vue/DebitCard.vue';
import resetSuccuesPage from './vue/resetSuccues.vue';

Vue.use(Router);

var router = new Router();
router.map({
  '/': {
    component: loginPage
  },
  '/forget': {
    component: forgetPage
  },
  '/register/:type': {
    component: registerPage
  },
  '/registerSuccues/:type': {
    component: registerSuccuesPage
  },
  '/resetSuccues': {
    component: resetSuccuesPage
  },
  '/loginSucess': {
    component: loginSucessPage
  },
  '/email': {
    component: EmailPage
  },
  '/phoneNumber': {
    component: PhoneNumberPage
  },
  '/PaymentSucceeded': {
    component: PaymentSucceePage
  },
  '/PaymentReset': {
    component: payResetPage
  },
  '/Wallet': {
    component: WalletPage
  },
  '/DebitCard': {
    component: DebitCardPage
  }
});
router.beforeEach(function () {
  window.scrollTo(0, 0);
});
router.redirect({
  '*': '/'
});
router.start(App, 'html');
